home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 18 / MacAddict_018_1998_02.iso / MEDIA / Main.dxr / Internal_4_EditBanner Code.ls < prev    next >
Encoding:
Text File  |  1997-12-04  |  2.4 KB  |  88 lines

  1. on getmainData
  2.   global myfile
  3.   if the machineType = 256 then
  4.     set i to the moviePath & "main.dat"
  5.   else
  6.     set i to the moviePath & "main.dat"
  7.   end if
  8.   set DaPath to i
  9.   if objectp(myfile) then
  10.     set myfile to 0
  11.   end if
  12.   set myfile to new(xtra("fileio"))
  13.   openFile(myfile, DaPath, 1)
  14.   set Adinfo to readFile(myfile)
  15.   put Adinfo into field "mainData"
  16.   closeFile(myfile)
  17.   set myfile to 0
  18. end
  19.  
  20. on countContent
  21.   global numOfEditBanners
  22.   set numOfEditBanners to the lineCount of member "mainData"
  23. end
  24.  
  25. on nextEditBanner
  26.   global currentBanner, numOfEditBanners
  27.   set currentBanner to currentBanner + 1
  28.   if currentBanner > numOfEditBanners then
  29.     set currentBanner to 1
  30.   else
  31.     nothing()
  32.   end if
  33. end
  34.  
  35. on nextEditMember
  36.   global currentBanner, numOfEditBanners, currentEditMember
  37.   set the itemDelimiter to TAB
  38.   set currentEditMember to 2
  39.   set i to item currentEditMember of line currentBanner of field "mainData"
  40.   set temp to item currentEditMember + 1 of line currentBanner of field "mainData"
  41.   if i = EMPTY then
  42.     set currentEditMember to 1
  43.     nextEditBanner()
  44.   else
  45.     puppetSprite(10, 1)
  46.     set the member of sprite 10 to member i of castLib "edit banners"
  47.     puppetTransition(23, 1, 80, 0)
  48.     set the text of field "dummyText" to temp
  49.     updateStage()
  50.   end if
  51.   set the itemDelimiter to ","
  52. end
  53.  
  54. on importEditBanners
  55.   global myfile
  56.   if the machineType = 256 then
  57.     set i to the moviePath & "EditBanners.dat"
  58.   else
  59.     set i to the moviePath & "EditBanners.dat"
  60.   end if
  61.   set DaPath to i
  62.   if objectp(myfile) then
  63.     set myfile to 0
  64.   end if
  65.   set myfile to new(xtra("fileio"))
  66.   openFile(myfile, DaPath, 1)
  67.   set Adinfo to readFile(myfile)
  68.   put Adinfo into field "editList"
  69.   closeFile(myfile)
  70.   set myfile to 0
  71.   if the machineType = 256 then
  72.     set finalPath to the moviePath & "\Images"
  73.   else
  74.     set finalPath to the moviePath & "Images:"
  75.   end if
  76.   set the itemDelimiter to TAB
  77.   set flibbertyGibbet to the number of items in field "editList"
  78.   repeat with x = 1 to flibbertyGibbet
  79.     set canOfWhupAss to finalPath & item x of field "editList"
  80.     set theName to item x of field "editList"
  81.     set the fileName of member x of castLib "edit Banners" to canOfWhupAss
  82.     set the itemDelimiter to "."
  83.     set the name of member x of castLib "edit Banners" to item 1 of theName
  84.     set the itemDelimiter to TAB
  85.   end repeat
  86.   set the itemDelimiter to ","
  87. end
  88.